package com.sscaipiao.android.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.sscaipiao.android.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Airay.Rong on 14-1-22.
 */
public class BallMatchJackpotItem extends JackpotItem {
	private String mTeam1;
	private String mTeam2;
	private TextView mTVTeam1;
	private TextView mTVTeam2;

	public BallMatchJackpotItem(Context context, AttributeSet attrs) {
		super(context, attrs);
		setOrientation(HORIZONTAL);
		TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.Jackpot);
		CharSequence temp = ta.getText(R.styleable.Jackpot_team1);
		if (temp != null) {
			mTeam1 = temp.toString();
		}
		temp = ta.getText(R.styleable.Jackpot_team2);
		if (temp != null) {
			mTeam2 = temp.toString() ;
		}
		ta.recycle();
		addContainerMain(R.layout.ballmatchjackpotitem);
		mTVTeam1 = (TextView) findViewById(R.id.team1);
		mTVTeam2 = (TextView) findViewById(R.id.team2);
		setTeam1(mTeam1);
		setTeam2(mTeam2);
	}


	public void setTeam1(String team) {
		if (team != null) {
			mTVTeam1.setText(team);
		}
	}
	public void setTeam2(String team) {
		if (team != null) {
			mTVTeam2.setText(team);
		}
	}
}
